﻿<UserControl x:Class="WpfAdvControls.AssemblyStarter.AssemblyStartersView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             d:DesignHeight="251" d:DesignWidth="521">
    <UserControl.Resources>
        <ResourceDictionary Source="pack://application:,,,/WpfAdvControls;component/Themes/DrawingResources.xaml" />
    </UserControl.Resources>
    <DockPanel>
        <Expander DockPanel.Dock="Top" IsExpanded="True" Header="Add assembly starter">
            <Grid Height="120">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <TextBlock Margin="5" Grid.Row="0" Grid.Column="0" Text="Assembly File" TextAlignment="Right"
                           VerticalAlignment="Center" />
                <TextBox Margin="5,5,33,5" Grid.Column="1" Name="assemblyFile" TextChanged="AssemblyFileTextChanged" />
                <Button Content="..." Grid.Column="1" Height="20" Margin="0,0,6,0" Name="openFile"
                        VerticalAlignment="Center" HorizontalAlignment="Right" Width="23" Click="OpenFileClick" />
                <TextBlock Margin="5" Grid.Row="1" Grid.Column="0" Text="Class Name" TextAlignment="Right"
                           VerticalAlignment="Center" />
                <ComboBox Margin="5" Grid.Row="1" Grid.Column="1" Name="className"
                          SelectionChanged="ClassNameSelectionChanged">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding FullName}" />
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>
                <TextBlock Margin="5" Grid.Row="2" Grid.Column="0" Text="Method Name" TextAlignment="Right"
                           VerticalAlignment="Center" />
                <ComboBox Margin="5" Grid.Row="2" Grid.Column="1" Name="methodName">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Name}" />
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>
                <Button Width="70" Height="20" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right"
                        Margin="0,0,5,0" VerticalAlignment="Center" Content="Add" Click="AddAssemblyStarter" />

            </Grid>
        </Expander>
        <DataGrid AutoGenerateColumns="False" Name="assembliesGrid" IsReadOnly="True">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Dll" Binding="{Binding Path=AssemblyFile}" Width="Auto" />
                <DataGridTextColumn Header="Class" Binding="{Binding Path=ClassName}" Width="Auto" />
                <DataGridTextColumn Header="Method" Binding="{Binding Path=MethodName}" Width="*" />
                <DataGridTemplateColumn Header="" Width="Auto">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button Tag="{Binding}" Click="StartClick">
                                <Button.Content>
                                    <Path Style="{StaticResource RunArrow}">
                                        <Path.LayoutTransform>
                                            <ScaleTransform ScaleX="0.5" ScaleY="0.5" />
                                        </Path.LayoutTransform>
                                    </Path>
                                </Button.Content>
                            </Button>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn Header="" Width="Auto">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button Click="DeleteClick" Tag="{Binding}" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>
    </DockPanel>
</UserControl>